If you work in a state establishment and your salary is transferred directly to a state-owned bank, then the laws of khums and Hajj do not apply on the salary. They both apply on amounts that you withdraw from the bank. Both conditions must be present (working for the state and the bank being owned by the state) in order for this ruling to apply. If one of the two conditions are not fulfilled, like if you work for a private establishment or the amount is transferred to a private bank, or both of them are not present, the regular laws of Khums and Hajj apply. That is, if the amount adds up to what is sufficient to cover the cost of Hajj, it becomes obligatory. Likewise, Khums has to be paid from the unused portion of it at the end of the Khums year.